T = 0:L = 0:B = 109:R = 248:' Set TLBR to window size
' Offset the rect to the center of the screen
CALL OFFSETRECT(T,ScrnR/2-R/2,(ScrnB/2+8)-B/2)
WINDOW Wnd2Build,"Window #2",(L,T)-(R,B),-2
CASE Year
T = 0:L = 0:B = 251:R = 333:' Set TLBR to window size
' Offset the rect to the center of the screen
CALL OFFSETRECT(T,ScrnR/2-R/2,(ScrnB/2+8)-B/2)
WINDOW Wnd2Build,"Window #3",(L,T)-(R,B),-2
BUTTON 1, 1,"1991",( 179, 64)-( 227, 84),1
BUTTON 2, 1,"1992",( 239, 64)-( 284, 84),1
BUTTON 3, 1,"1993",( 178, 88)-( 226, 108),1
BUTTON 4, 1,"1994",( 240, 88)-( 285, 108),1
BUTTON 5, 0,"Find Year",( 31, 222)-( 116, 238),3
BUTTON 6, 0,"Clear",( 150, 222)-( 215, 238),3
BUTTON 7, 2,"Cancel",( 243, 222)-( 308, 238),3
TEXT 0,12,0,0
EDIT FIELD 1,"?",( 36, 67)-( 92, 83),1,2
END SELECT
RETURN
'
'
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
"Format Wnd"
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
'
CALL GETPENSTATE(PenSpecs$):' Record the current pen state
'
TxFont=PEEK WORD(WINDOW(14)+68):' Record the current font specs
TxFace=PEEK WORD(WINDOW(14)+70)
TxMode=PEEK WORD(WINDOW(14)+72)
TxSize=PEEK WORD(WINDOW(14)+74)
'
'
LONG IF WINDOW(1) = Main
T = 39:L = 243:B = 156:R = 414
PEN 8,3,1,8,19
CALL PAINTRECT(T)
PEN ,,1,8,0
CALL FRAMERECT(T)
T = 177:L = 7:B = 267:R = 204
CALL PENNORMAL:' If you haven't installed the proper
DEF SHADOWBOX(T):' ZMover library-this won't work
T = 122:L = 261:B = 143:R = 314
CALL PENNORMAL:' If you haven't installed the proper
DEF SHADOWBOX(T):' ZMover library-this won't work
T = 3:L = 2:B = 30:R = 419
TEXT 22,24,25,0
Temp$ = "Age Calculator"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 31:L = 4:B = 31:R = 416
PEN 1,1,1,8
CALL MOVETO(L,T):CALL LINETO(R,B)
T = 59:L = 57:B = 83:R = 114
TEXT ,12,1,0
Temp$ = "Year Of Birth"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 48:L = 260:B = 67:R = 398
TEXT 3,14,,0
Temp$ = YS$
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 85:L = 253:B = 109:R = 320
TEXT 22,12,,0
Temp$ = "Before"+Cr$+"Birthday"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
L = 333:R = 405
Temp$ = "After Birthday"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 123:L = 266:B = 139:R = 307
TEXT 0,,0,0
Temp$ = BB$
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 121:L = 344:B = 145:R = 400
CALL PENNORMAL:' If you haven't installed the proper
DEF SHADOWBOX(T):' ZMover library-this won't work
T = 123:L = 352:B = 139:R = 393
Temp$ = AB$
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 181:L = 11:B = 261:R = 200
Temp$ = "Select a Year button to the right. Enter a year into the box above and click the calculate age button to receive the answer."
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 0)
T = 72:L = 251:B = 72:R = 406
PEN 4,8,1,8
CALL MOVETO(L,T):CALL LINETO(R,B)
T = 76:L = 327:B = 151:R = 327
PEN 2,4,1,8
CALL MOVETO(L,T):CALL LINETO(R,B)
END IF:' End of Main format
'
'
LONG IF WINDOW(1) = About
T = 6:L = 5:B = 101:R = 243
TEXT 3,14,1,0
Temp$ = "Age Calculator"+Cr$+"by"+Cr$+"Michael D. Powell"+Cr$+"January 1991"+Cr$+"Written in ZBasic"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
END IF:' End of About format
'
'
LONG IF WINDOW(1) = Year
T = 41:L = 167:B = 117:R = 295
PEN 4,6,1,8,3
CALL FRAMERECT(T)
T = 105:L = 5:B = 209:R = 139
CALL PENNORMAL:' If you haven't installed the proper
DEF SHADOWBOX(T):' ZMover library-this won't work
T = 5:L = 2:B = 32:R = 331
TEXT 22,24,24,0
Temp$ = "Year Calculator"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 31:L = 3:B = 31:R = 329
PEN 2,4,1,8,0
CALL MOVETO(L,T):CALL LINETO(R,B)
T = 46:L = 26:B = 62:R = 102
TEXT 0,12,0,0
Temp$ = "Enter Age"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 119:L = 142:B = 167:R = 332
Temp$ = "If the birthday for this year has past this person was born in:"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 0)
T = 151:L = 202:B = 167:R = 282
Temp$ = YOBA$
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 48:L = 180:B = 60:R = 286
TEXT 22,,1,0
Temp$ = "Present Year:"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 106:L = 7:B = 202:R = 133
TEXT ,10,0,0
Temp$ = "You must first select the present year and then enter the age of the person in the box above. Click find year to see when the person was born"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
T = 170:L = 143:R = 322
TEXT 0,12,,0
Temp$ = "otherwise the correct year was:"
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 0)
T = 186:L = 215:B = 202:R = 295
Temp$ = YOBB$
CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T, 1)
END IF:' End of Year format
'
'
TEXT TxFont,TxSize,TxFace,TxMode:' Restore the font specs
'
CALL SETPENSTATE(PenSpecs$):' Restore the pen
'
RETURN
'
'
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
"Capture"
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
'
LONG IF WINDOW(0) = Main
YS = VAL(YS$) 'WINDOW 1 capture routines here
YRB = VAL(EDIT$(1))
BB = YS - (YRB+1):AB = YS - (YRB)
BB$ = STR$(BB):AB$ = STR$(AB)
GOSUB "Format Wnd"
END IF
'
LONG IF WINDOW(0) = Year
AG = VAL(EDIT$(1)) 'WINDOW 3 capture routines here
YOBA = BY - AG
YOBB = (BY-1) - AG
YOBA$ = STR$(YOBA)
YOBB$ = STR$(YOBB)
END IF
RETURN
'
'
'
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
"Initialize"
'”’”’”’”’”’”’”’”’”’’
'‘“‘“‘“‘“‘“‘“‘“‘“‘“‘
FN Push(2):' Push first window on to stack
FN Push(OpenEvent):' Tell my event manager to open the window